Copyright(C) 1994,1995,1996,1997 Terumasa KODAKA , Takeshi KONO


■Text GDC control
Target            Normal, high resolution
Chip              μPD7220, μPD7220A, μPD72020
Explanation     o The PC-9800 series uses two GDCs to display the text screen and graphic screen.
                  Among these, the GDC that handles the text screen performs master operation and
                  generates synchronization signals for the CRT.
                o PC-9801 first generation, E, F, M, U, VF, VM2 is μPD7220, PC-9801 series after
                  PC-H98, PC-9821, PC-98GS, PC-9801FA, NS/T is μPD72020, others. The μPD7220A is
                  used in the PC-9801 series. The basic commands are the same.
                o The first generation PC-9801/E does not have a kanji ROM in it's standard state,
                  and there is no memory at odd addresses in the text VRAM.
                o See GDC datasheet for details.
Related           A000:0000~7FFFh


I/O               0060h
Name              Text GDC Status Read
Text              GDC Parameter Write
Chip              GDC
Function
                  [READ]
                  bit 7: LIGHT PEN DETECT
                  bit 6: HORIZONTAL BLANK
                  bit 5: VERTICAL SYNC
                  bit 4: DMA EXECUTE
                  bit 3: DRAWING
                  bit 2: FIFO EMPTY
                  bit 1: FIFO FULL
                  bit 0: DATA READY
                  [WRITE]
                  bit 7~0: GDC parameter write
Description     o Reads the text GDC status and outputs parameters.
                o See the μPD7220 datasheet for details.
Related           I/O 0062h


I/O               0062h
Name              Text GDC Data Read
                  Text GDC Command Write
Chip              GDC
Function
                  [READ]
                  bit 7~0: GDC data read
                  [WRITE]
                  bit 7~0: GDC command write
                  --------+----------------------------
                  Command | Name
                  --------+----------------------------
                  00h     |RESET1
                  01h     |RESET2
                  05h     |STOP2
                  09h     |RESET3
                  0Ch     |STOP1
                  0Dh     |START
                  0Eh,0Fh |SYNC
                  20~3Fh |WRITE,DMAW
                  46h     |ZOOM
                  47h     |PITCH
                  49h     |CSRW
                  4Bh     |CSRFORM
                  4Ch     |VECTW
                  68h     |TEXTE
                  6Bh     |START
                  6Ch     |VECTE
                  70〜7Fh |SCROLL,TEXTW
                  6Eh     |SLAVE
                  6Fh     |MASTER
                  A0~BFh |READ,DMAR
                  C0h     |LPEN
                  E0h     |CSRR
                  4Ah     |MASK
                  --------+----------------------------
                  * Not all commands are available.
Description     o Read text GDC data and output commands.
                o See the μPD7220 datasheet for details.
Related           I/O 0060h


I/O               0064h
Name              VSYNC interrupt trigger
Target            Normal, high resolution
Function
                  [READ] None
                  [WRITE]
                  bit 7~0: arbitrary
Explanation     o If any value is output, an INT 0Ah interrupt will be generated once at the start of the next VSYNC.
                u The VSYNC interrupt rate depends on the screen mode, etc.
                  Some functions of u INT 18h stop VSYNC interrupts. After executing such a function, you need to output
                  an arbitrary value to this port to restart the VSYNC interrupt.
Related           INT 18h - Function 2Ah
                  INT 18h - Function 30h
                  I/O 0002h bit 2
                  I/O 0064h
                  I/O 498Eh bit 0■[PC-9801NS/R・P・NL/R]


I/O               0066h
Name              Text screen brightness
Target            Unknown
Function
                  [READ/WRITE]
                  bit 7~0: Details unknown
Explanation     o Details unknown


I/O               0068h
Name              Mode F/F register 1
Target            Normal, high resolution
Function
                  [READ]■[PC-H98, PC-9821, PC-9801BA2・BS2・BX2・BA3・BX3・BX4・NS/A]
                  bit 7: KAC Mode reading
                         0=code access
                         1=dot access
                  bit 6: NVMW PERMIT reading
                         0=write-protected
                         1=write permission
                  bit 5: unused
                  bit 4: unused
                  bit 3: Column WIDTH reading
                         0=80 digits
                         1=40 digits
                  bit 2: GPAPHIC Mode reading
                         0=color
                         1=monochrome
                  bit 1: unused
                  bit 0: ATR SEL reading
                         0=vertical line
                         1=Simple graph

                  [WRITE] Write mode register 1
                  bit 7~4: Unused (always set to 0000b)
                  bit 3~1: ADR2~0
                  bit 0: DT
                         ---------------------------------------------------------------
                         0000000nb: ATR SEL
                                    Text screen attribute bit 4 function■[Normal]
                                    0(00h)=Vertical line
                                    1(01h)=Simple graphics
                                    * Set the function of attribute bit 4 on the text screen.
                                      Simple graphics mode is used on PC-8001 compatible graphics screens.
                                    u Windows95 does not support simple graphics mode.
                         ---------------------------------------------------------------
                         0000001nb: GPAPHIC Mode
                                    Standard graphics mode color mode selection ■[Normal]
                                    0(02h)=color
                                    1(03h)=Monochrome
                                    * Set the graphics screen in 200 line mode.
                                    Related I/O 09A0h - 01h
                         ---------------------------------------------------------------
                         0000010nb: Column WIDTH
                                    Text screen digits■[Normal]
                                    0(04h)=80 digits
                                    1(05h)=40 digits
                         ---------------------------------------------------------------
                         0000011nb: FONT SEL
                                    Text screen character font■[Normal]
                                    0(06h) = 6x8 dots (at CRT resolution 200 lines)
                                    1(07h) = 7x13 dots (at CRT resolution 400 lines)
                                    * You can also switch to 6x8 dot font when CRT resolution is 400 lines. At this time,
                                      the resolution of the text screen will be 200 lines vertically, and the ANK characters
                                      will be displayed in a 6x8 dot font. Only the top half of double-byte characters is displayed.
                         ---------------------------------------------------------------
                         0000100nb: GRP Mode
                                    Graphic screen odd raster display ■[Normal]
                                    0(08H)=Display odd raster
                                    1(09h)=Do not display odd rasters
                                    -----------+------------+---------------------------
                                    CRT        | Graphic    |
                                    Resolution | Resolution | Odd Raster
                                    -----------+------------+---------------------------
                                    200 lines  | 200 lines  | Display (OUT 68h,08h)
                                    400 line   | 200 line   | Do not display (OUT 68h,09h)
                                    400 lines  | 400 lines  | Display (OUT 68h,08h)
                                    -----------+------------+---------------------------
                                    * If you do not display odd rasters, only the even rasters will display graphic data,
                                      and the odd rasters will be black. To display a display compatible with PC-8801.
                                    * If set to 0 (08h) when the CRT resolution is 400 lines and the graphic resolution is 200 lines,
                                      the same data as the raster above will be displayed for 2 lines each instead of the black
                                      odd number raster. This is because GDC uses the CSRFORM command to enlarge the image twice
                                      vertically and output it.
                                    Related I/O 09A0h - 02h
                         ---------------------------------------------------------------
                         0000101nb: KAC Mode
                                    Kanji access ■ [Normal (except for the first generation PC-9801), high resolution]
                                    0(0Ah)=code access
                                    1(0Bh)=dot access
                                    * When set to dot access mode, Kanji cannot be displayed on the text screen.
                                      Instead, fonts can be read from Kanji CG not only during the vertical synchronization period.
                                    * When set to code access mode, kanji can be displayed on the text screen. Instead, fonts can
                                      be read from Kanji CG only during the vertical synchronization period.
                                    * The first generation PC-9801 cannot be set to dot access mode. Always in the same state as code access.
                                    Related INT 18h - Function 0Ah
                                            INT 18h - Function 0Bh
                                            0000:053Ch bit 3■[Normal]
                                            0000:0546h bit 3■[High resolution]
                         ---------------------------------------------------------------
                         0000110nb: NVMW PERMIT
                                    Memory switch write protection
                                    0(0Ch)=write prohibited
                                    1(0Dh)=Write permission
                                    * Flag that allows/disallows writing to the memory switches located at 3FE2 to 3FFEh of the text VRAM segment.
                                    Related A000:3FE2~3FFEh■[Normal]
                                            E000:3FE2~3FFEh■[High resolution]
                         ---------------------------------------------------------------
                         0000111nb: DISP ENABLE
                                    Screen display ON/OFF
                                    1(0Fh)=Displayable
                                    0(0Eh)=Do not display all screens
                                    * Control the screen display of both text and graphics.
                                    Related I/O 09A0h - 03h
                         ---------------------------------------------------------------
Explanation     o Control various functions related to screen display.
                o It is recommended not to use simple graphs, monochrome graphics,
                  40-digit mode, etc. These are not supported in Windows DOS compatible boxes.
                u Some models can read some settings of I/O 006Ah through I/O 09A0h.
Related           I/O 09A0h


I/O               006Ah
Name              Mode F/F register 2
Applicable to     devices capable of displaying 16 colors or later, etc.
Function
                  [READ]■[PC-H98,PC-9821,PC-9801BA2・BS2・BX2・BA3・BX3・BX4・NS/A・NL/A]
                  bit 7~5: unused
                  bit 4: Ruled line connection status
                         1=Connect borders
                         0=Do not connect borders
                         * I/O 006Eh - 1Eh, 1Fh settings can be read
                  bit 3~1: unused
                  bit 0: I/O 006Eh mask
                         1=mask
                         0=do not mask
                         * I/O 006Eh - 02h,03h settings can be read
                  [WRITE]
                  bit 7~1: Mode F/F number selection
                  bit 0: Mode F/F status
                         --------------------------------------------------------------
                         0000000nb: Standard graphics mode 8/16 color settings [Normal]
                                    0(00h)=8 colors
                                    1(01h)=16 colors
                                    * 16 color mode does not exist in PC-9801 first generation E・F・M.
                                      High resolution is always in 16 color mode.
                                    Related I/O 09A0h - 04h
                         --------------------------------------------------------------
                         0000010nb: EGC mode (*1)
                                    0(04h)=Compatible (GRCG) mode
                                    1(05h)=Extended (EGC) mode
                                    * When changing from extended mode to compatibility mode, FFF0h must be set to I/O 04A0h.
                                    * Do not change the mode during GDC drawing.
                                    * EGC is installed in high-resolution cameras other than XA, V30HL, V33A, and normal models equipped with a CPU of 286 or later.
                                    Related 0000:0495h
                                            0000:054Dh bit 6
                                            I/O 007Ch
                                            I/O 04A0~04AFh
                                            I/O 09A0h - 07h
                                            I/O EE8Eh
                         --------------------------------------------------------------
                         0000011nb: (*1) F/F change
                                    0(06h)=Forbidden
                                    1(07h)=Allowed
                                    Related I/O 09A0h - 08h
                         --------------------------------------------------------------
                         0000100nb: Undocumented
                                    ■[PC-9821Ce・Ne・Af・Ap2・As2・Cs2・Ce2・An]
                                    Related I/O 006Ah - 46h,47h
                         --------------------------------------------------------------
                         0000111nb: Multimedia architecture control (Undocumented)
                                    ■[PC-98GS]
                                    0(0Eh)=disable
                                    1(0Fh)=enable
                                    Related INT 1Fh - Function 00h
                                            INT 1Fh - Function 01h
                                            0000:0458h bit 6
                                            I/O A46Eh bit 6
                         --------------------------------------------------------------
                         0010000nb: Multicolor display mode (*1)■[PC-H98]
                                    0(20h)=Standard mode
                                    1(21h)=Multicolor expansion mode
                                    * (*2) is valid only in multicolor expansion mode.
                                    Related 0000:054Dh bit 7
                                            I/O 09A0h - 0Ah
                         --------------------------------------------------------------
                         0010000nb: Multicolor display mode (*1)
                                    ■[Models equipped with extended graph architecture]
                                    0(20h)=Standard graphics mode
                                    1(21h)=Enhanced graphics mode
                                    Related INT 18h - Function 4Dh
                                            0000:054Dh bit 7
                                            I/O 09A0h - 0Ah
                         --------------------------------------------------------------
                         0010001nb: Display color settings (*1,*2)■[PC-H98]
                                    0(22h)=256 colors/16M colors
                                    1(23h)=65536 colors
                                    Related I/O 09A0h - 0Eh
                         --------------------------------------------------------------
                         0010010nb: 64K color display palette (*1,*2)■[PC-H98]
                                    0(24h)=Palette not used
                                    1(25h)=Some pallets
                                    * Valid only in display color 65536 color mode.
                                    Related I/O 09A0h - 0Fh
                         --------------------------------------------------------------
                         0010011nb: Full screen reverse (*1)■[PC-H98]
                                    0(26h)=OFF
                                    1(27h)=ON
                                    Related I/O 09A0h - 11h
                         --------------------------------------------------------------
                         0010100nb: Text, graphics composition (Undocumented)
                                    ■[PC-H98,PC-98GS]
                                    0(28h)=normal display
                                    1(29h)=XOR composite display
                                    Related I/O 09A0h - 13h
                         --------------------------------------------------------------
                         0010101nb: 256-color palette register high-speed writing (*1)■[PC-H98]
                                    0(2Ah)=OFF
                                    1(2Bh)=ON
                                    Related I/O 09A0h - 18h
                                            I/O 09A2h bit 0
                         --------------------------------------------------------------
                         0010110nb: 256 colors overscan color (*1,*2)■[PC-H98]
                                    0(2Ch)=Not used
                                    1(2Dh)=Use
                                    * 256-color overscan color is used when adding color to the outside of the display area.
                                    * Actually, it can be used even if the 256-color board is not installed.
                                      (Undocumented)
                                    Related I/O 09A0h - 12h
                                            I/O 09A6h■[PC-H98]
                         --------------------------------------------------------------
                         0010111nb: Undocumented■[PC-H98]
                                    Related I/O 09A0h - 1Bh
                         --------------------------------------------------------------
                         0100000nb: Text/graphic display mode (Undocumented)
                                    ■[Normal]
                                    0(40h)=CRT mode
                                    1(41h)=Plasma display/LCD mode
                                    * In CRT mode, text extends one dot to the left of graphics. No deviation occurs in plasma display mode.
                                    * Enhanced graphics mode always switches to plasma display mode.
                                    * In the high resolution mode of XL and RL, outputting 41h shifts in the opposite direction from normal mode,
                                      and outputting 40h eliminates the shift.
                                    * In H98's high-resolution mode (non-interlaced), outputting 41h eliminates the misalignment.
                                      Related I/O 0042h bit 4
                                              I/O 09A0h - 05h
                         --------------------------------------------------------------
                         0100001nb: Text/graphic display mode 2 (Undocumented)
                                    ■[98NOTE]
                                    0(42h)=Normal display
                                    1(43h)=Text and graphics are shifted one dot to the right, and the right edge is no longer visible.
                         --------------------------------------------------------------
                         0100010nb: Undocumented
                                    ■[PC-H98]
                                    0(44h)=Normal display
                                    1(45h)=Display is not performed properly.
                                    Related I/O 09A0h - 06h
                                    ■[PC-9821Ap・As・Ae・Af・Ap2・As2・An・Ap3・As3]
                                    0(44h)=Normal mode
                                    1(45h)=High resolution mode
                                    * Valid only when PC-9821A-E02 (98 high resolution board) is installed.
                         --------------------------------------------------------------
                         0100011nb: Undocumented
                                    ■[PC-9821Ce・Ne・Af・Ap2・As2・Cs2・Ce2・An・Ap3・As3]
                                    Related I/O 006Ah - 08h,09h
                                            I/O 09A0h - 18h
                         --------------------------------------------------------------
                         0100100nb: Undocumented■[PC-H98]
                                    Related I/O 09A0h - 19h
                         --------------------------------------------------------------
                         0110000nb: EEGC mode (*1)■[PC-H98]
                                    0(60h)=EGC compatible mode
                                    1(61h)=Enhanced EGC mode
                                    * I/O 007Ch bit 7 (CGmode) must be 1 when transitioning to EGC expansion mode.
                                    * I/O 04A0h must be FFF0h when transitioning to EGC compatible mode.
                                    Related I/O 09A0h - 15h
                                            I/O 08A0h
                                            I/O 08A2h
                                            I/O 08A4h
                         --------------------------------------------------------------
                         0110001nb: VRAM configuration (*1,*2)■[PC-H98]
                                    0(62h)=Plain access
                                    1(63h)=Packed pixel
                                    Related I/O 09A0h - 0Bh
                         --------------------------------------------------------------
                         0110011nb: Drawing processor (*1)■[PC-H98]
                                    0(66h)=Use GDC
                                    1(67h)=AGDC used
                                    Related I/O 09A0h - 14h
                         --------------------------------------------------------------
                         0110100nb: VRAM configuration settings (*1) (Undocumented)■[PC-H98,PC-9821]
                                    0(68h)=400 line configuration
                                      o 400 line mode default.
                                      o I/O 00A4h can be used
                                      o VRAM has a 128KB (256KB) boundary
                                    1(69h)=800 line configuration
                                      o 480 line mode default.
                                      o I/O 00A4h is not available
                                      o VRAM has a 256KB (512KB) boundary
                                    Related INT 18h - Function 2Ah■[PC-H98]
                                            INT 18h - Function 30h■[Extended graph architecture equipped machine]
                                            I/O 00A4h
                                            I/O 09A0h - 0Dh
                         --------------------------------------------------------------
                         0110111nb: Undocumented■[PC-H98]
                                    0(6Ah)=Normal display
                                    1(6Bh)=Display is not performed properly.
                         --------------------------------------------------------------
                         0110110nb: VRAM bitmap direction (Undocumented)■[PC-H98]
                                    0(6Ch)=Forward direction (higher bits are on the left)
                                    1(6Dh)=Reverse direction (lower bit is on the left)
                                    Related I/O 09A0h - 17h
                         --------------------------------------------------------------
                         0110111nb: Undocumented■[PC-H98]
                                    Related I/O 09A0h - 1Ch
                         --------------------------------------------------------------
                         1000000nb: Undocumented
                                    Related 0000:045Eh bit 7
                                    I/O 09A0h - 1Eh■[PC-9821Ap・As・Ae]
                         --------------------------------------------------------------
                         1000001nb: GDC CLOCK-1■[Normal]
                                    0(82h)=2.5MHz
                                    1(83h)=5.0MHz
                                    * To set the GDC clock to 5.0MHz, GDC CLOCK-2 must also be set to 5.0MHz.
                                    * To set the GDC clock to 2.5MHz, you can set either GDC CLOCK-1 or 2.
                                    Related 0000:054Dh bit 2
                                            I/O 0031h bit 7
                                            I/O 006Ah - 84h,85h
                                            I/O 09A0h - 09h
                         --------------------------------------------------------------
                         1000010nb: GDC CLOCK-2■[Normal]
                                    0(84h)=2.5MHz
                                    1(85h)=5.0MHz
                                    Related 0000:054Dh bit 2
                                            I/O 0031h bit 7
                                            I/O 006Ah - 82h,83h
                                            I/O 09A0h bit 1
                         --------------------------------------------------------------
                         1000011nb: Unknown■[PC-9821Ne3・Nd2・Na7・Nx]
                         --------------------------------------------------------------
                         1000100nb: Unknown■[PC-9821Ne3・Nd2・Na7・Nx]
                         --------------------------------------------------------------
                         1000101nb: Unknown■[PC-9821Ne3・Nd2・Na7・Nx]
                         --------------------------------------------------------------
                         1000111nb: VRAM use selection (Undocumented)
                                    ■[CL-GD5428,5430 equipped machine]
                                    0(8Eh)=98 graphics
                                    1(8Fh)=CL-GD5428・5430
                                    * In models equipped with CIRRUS LOGIC's accelerator, VRAM is shared between
                                      98 graphics and the accelerator chip. Set which graphics chip uses VRAM.
                                    Related I/O 0FAAh,0FABh - 03h
                         1000111nb: RAM window use selection (Undocumented)
                                    ■[Vision864 equipped machine]
                                    0(8Eh)=Normal RAM window
                                    1(8Fh)=Vision864 memory mapped I/O window
                                    * In models equipped with Vision864, 8 and 9 banks of RAM windows are shared to project memory-mapped
                                      I/O of the Vision864 accelerator chip. Set which purpose banks 8 and 9 will be used for.
                                    Related 8000:0000~9000:FFFFh
                                            I/O 0FAAh,0FABh - 03h
                         --------------------------------------------------------------
                         1010100nb: Undocumented■[PC-9821Ap・As・Ae・Af・Ap2・As2]
                         --------------------------------------------------------------
                         1100000nb: Undocumented■[PC-H98]
                                    Related I/O 09A0h - 1Dh
                         --------------------------------------------------------------
                         1100001nb: Undocumented■[PC-H98]
                                    0(C2h)=normal
                                    1(C3h)=Screen is not displayed properly
                                    Related I/O 09A0h - 16h
                         --------------------------------------------------------------
                         1100010nb: Graph GDC operation mode (*1)■[PC-H98]
                                    0(C4h)=Slave operation
                                    1(C5h)=Master operation
                         --------------------------------------------------------------
                         1100100nb: Undocumented■[PC-H98]
                                    Related I/O 09A0h - 1Ah
                         --------------------------------------------------------------
                         1110000nb: Undocumented
                         --------------------------------------------------------------
                         1110001nb: Undocumented■[PC-H98]
                         --------------------------------------------------------------
                         1110100nb: Undocumented
                         --------------------------------------------------------------
                         1110111nb: Undocumented
                         --------------------------------------------------------------
Explanation     o Change various settings of mode F/F2.
                u Some models can read some settings of I/O 006Ah through I/O 09A0h.
Related I/O       09A0h


I/O               006Ch
Name              Border color
Target            Normal
Function
                  [READ] None
                  [WRITE]
                  bit 7: Brightness (Undocumented) ■[PC-H98 series, PC-98GS]
                         1=Half brightness
                         0=normal
                  bit 6~4: Color code
                         000b=Black
                         001b=Blue
                         010b=Red
                         011b=Purple
                         100b=Green
                         101b=Light blue
                         110b=Yellow
                         111b=White
                  bit 3~0: Unused (always 0000b)
Description     o Specify the color to be generated in the overscan area of the display.
Related           INT 1Fh - Function 93h
                  0000:05B4h
                  I/O 09AEh■[PC-H98]


I/O               006Eh
Name              Monitor frequency switching
Undocumented
Target            Normal (excluding PC-9801 first generation, BA, BX, BA2, BS2, BX2, BA3, BX3, BX4, PC-H98, PC-9821, 98NOTE)
Function
                  [READ] None
                  [WRITE]
                  bit 7~0: Horizontal synchronization setting
                            00h=15kHz
                            01h=24kHz
Description     o Sets the horizontal sync frequency of display output.
                u Image of I/O 006Ch in the first generation of PC-9801.
                u For PC-9801E/F/M or later, only the image +LSB of I/O 006Ch can be frequency switched.
Related           I/O 0035h bit 3


I/O               006Eh
Name              Extended Attribute
Undocumented
Target            PC-H98, PC-9821, PC-9801BA2・BS2・BX2・BA3・BX3・BX4
Function
                  [READ]
                  bit 7: NPC color mode
                         1=NPC color mode
                         0=98 compatibility mode
                         Related I/O 006Eh - 16h,17h
                  bit 6,5: unknown
                  bit 4: Border mode
                         1=I/O settings
                         0=VRAM settings
                         Related I/O 006Eh - 12h,13h
                                 I/O 00A7h
                  bit 0: NPC mode enable
                         1=mode
                         0=98 compatibility mode
                         Related I/O 006Eh - 02h,03h
                  [WRITE]
                  bit 7~1: Mode F/F number selection
                  bit 0: Mode F/F status
                         --------------------------------------------------------------
                         0000001nb: Mode change prohibition setting
                                    0(02h)=Mode change prohibited
                                    1(03h)=Mode change allowed
                                    Related I/O 006Eh bit 0
                                            I/O 006Ah bit 0
                         --------------------------------------------------------------
                         0000010nb: Unknown
                         --------------------------------------------------------------
                         0000011nb: Unknown
                         --------------------------------------------------------------
                         000010nnb: Attribute mode related■[PC-H98]
                                    00b(08h)=default
                                    01b(09h)=1 byte extended text
                                    10b(0Ah)=1 byte extended text
                                    11b(0Bh)=1 byte extended text
                         --------------------------------------------------------------
                         0000110nb: Attribute mode related■[PC-H98]
                                    0(0Ch)=JEH mode
                                    1(0Dh)=EGH mode
                                    * I/O 006Eh - access following 0Eh,0Fh
                         --------------------------------------------------------------
                         0000111nb: Attribute■[PC-H98]
                                    0(0Eh)=PC mode
                                    1(0Fh)=Attribute Extended Mode
                         --------------------------------------------------------------
                         0001000nb: Unknown■[PC-H98]
                                    0(10h)=unknown
                                    1(11h)=unknown
                                    Related 0000:0459h bit 1
                         --------------------------------------------------------------
                         0001001nb: Text border color
                                    0(12h)=Follow I/O set value (I/O 00A7h set value)
                                    1(13h)=Follow VRAM attributes (set at startup)
                                    Related 0000:0459h bit 2
                         --------------------------------------------------------------
                         0001010nb: Text display mask■[PC-H98]
                                    0(14h)=normal
                                    1(15h)=No text display, only attributes are valid
                         --------------------------------------------------------------
                         0001100nb: Text display color mode■[PC-H98]
                                    0(16h)=98 compatibility mode
                                    1(17h)=NPC text color
                                    Related I/O 006Eh bit 7
                         --------------------------------------------------------------
                         0001101nb: Unknown
                         --------------------------------------------------------------
                         0001111nb: Ruled line connection status■[PC-H98, PC-9821A high resolution]
                                    1(1Eh)=Connect ruled lines
                                    0(1Fh)=Do not connect ruled lines
                                    Related I/O 006Ah bit 4
                         --------------------------------------------------------------
                         0010000nb: Unknown■[PC-H98, PC-9821Ap・As・Ae]
                                    0(20h)=unknown (at 24kHz)
                                    1(21h)=unknown (at 31kHz)
                                    * At OUT, wait by OUT 5Fh,AL is required
                         --------------------------------------------------------------
                         Explanation o Configure the attributes expanded in the PC-H98 series.
                                     o Details unknown.
Related		  0000:0459h bit 1,0
                  I/O 00A7h
                  I/O 006Ah


I/O               00A7h
Name              Text relationship control
Undocumented
Target            PC-H98
Function
                  [READ] Unknown
                  [WRITE]
                  bit 7~0: Text relation control
                  --------------------------------------------------------------
                  0000nnnnb(0nh)=Border color setting■[PC-H98]
                                 bit 3: I intensity
                                 bit 2: G Green
                                 bit 1: B blue
                                 bit 0: R Red
                  --------------------------------------------------------------
                  0001000nb=Text screen font set switching■[PC-H98]
                            0(10h)=default
                            1(11h)=special character
                  --------------------------------------------------------------
                  0001001nb=Text screen font size switching■[PC-H98 Hi-Res]
                            0(12h)=16 dots
                            1(13h)=24 dots
                  --------------------------------------------------------------
                  0001010nb=Attribute color
                            0(14h)=enabled
                            1(15h)=enabled
                  --------------------------------------------------------------
                  0010nnnnb=Number of lines for height double ■[PC-H98]
                            * details unknown
                  --------------------------------------------------------------
Explanation     u Switch the font set and size.
                u Set the border color.
                o Details unknown
Related           INT 18h - Function 2Ch■[PC-H98]


===============================================================================


■Graphic GDC
Target            Normal/High Resolution
Chip              GDC (μPD7220, μPD7220A, μPD72020)
Explanation     o The PC-9800 series uses two GDCs to display the text screen and graphic screen. Among these,
                  the GDC that handles the graphic screen performs slave operation and displays the graphic screen in
                  synchronization with the synchronization signal generated by the master text GDC.
                o See GDC datasheet for details.
Related           I/O 0060h
                  I/O 0062h
                  A800:0000〜7FFFh
                  B000:0000~7FFFh
                  B800:0000〜7FFFh
                  E000:0000~7FFFh


I/O               00A0h
Name              Graphic GDC Status Read
Graphic           GDC parameter light
Chip              GDC
Function
                  [READ] GDC status read
                  bit 7: LIGHT PEN DETECT (always shows 1)
                  bit 6: HORIZONTAL BLANK
                  bit 5: VERTICAL SYNC
                  bit 4: DMA EXECUTE
                  bit 3: DRAWING
                  bit 2: FIFO EMPTY
                  bit 1: FIFO FULL
                  bit 0: DATA READY
                  [WRITE]
                  bit 7~0: GDC parameter write
Explanation     o Reads the graphic GDC status and outputs parameters.
                o See the μPD7220 datasheet for details.
Related           I/O 00A2h


I/O               00A2h
Name              Graphic GDC data read
Graphic           GDC Command Lite
Chip              GDC
Function
                  [READ]
                  bit 7~0: GDC data read
                  [WRITE]
                  bit 7~0: GDC command write
                  --------+----------------------------
                  command | name
                  --------+----------------------------
                  00h     | RESET1
                  01h     | RESET2
                  05h     | STOP2
                  09h     | RESET3
                  0Ch     | STOP1
                  0Dh     | START
                  0Eh,0Fh | SYNC
                  20~3Fh | WRITE,DMAW
                  46h     | ZOOM
                  47h     | PITCH
                  49h     | CSRW
                  4Bh     | CSRFORM
                  4Ch     | VECTW
                  68h     | TEXTE
                  6Bh     | START
                  6Ch     | VECTE
                  70〜7Fh | SCROLL,TEXTW
                  6Eh     | SLAVE
                  6Fh     | MASTER
                  A0~BFh | READ,DMAR
                  C0h     | LPEN
                  E0h     | CSRR
                  4Ah     | MASK
                  --------+----------------------------
                  * Not all commands are available.

Description     o Reads graphic GDC data and outputs commands.
                o See the μPD7220 datasheet for details.
Related           I/O 00A0h


-------------------------------------------------------------------------------


■VRAM plane switching
Target            Normal (Excluding PC-9801 first generation/U)
Explanation     o In normal mode except for the first generation PC-9801/U, the graphic VRAM exists in two banks at
                  the same address, and it is possible to select the drawing plane and display plane respectively.
                o In the PC-9801VF/VM2, there is no VRAM in the E bank area in the initial state, so it can only
                  display up to 8 colors. By installing a 16-color board, this area of VRAM can be used.

Related           A800:0000〜7FFFh
                  B000:0000~7FFFh
                  B800:0000〜7FFFh
                  E000:0000~7FFFh
                  0000:054Ch bit 2

I/O               00A4h
Name              Display screen selection register
Function
                  [READ]■[PC-H98,PC-98GS,PC-9821,PC-9801BA2・BS2・BX2・BA3・BX3・BX4・NS/A only]
                  bit 7~1: unused
                  bit 0: Display plane selection state
                         0=plain 0
                         1=plane1
                  [WRITE]
                  bit 7~0: Display plane selection
                            00h=plane 0
                            01h=plane 1
Explanation     o Select the display screen.
                o Also valid in extended graphics mode 400 lines.
                o Plane 1 does not exist in the first generation PC-9801/U.
Related           I/O 00A6h


I/O               00A6h
Name              Drawing screen selection register
Function
                  [READ]■[PC-H98,PC-98GS,PC-9821,PC-9801BA2・BS2・BX2・BA3・BX3・BX4・NS/A only]
                  bit 7~1: unused
                  bit 0: Drawing plane selection state
                         0=plain 0
                         1=plane1
                  [WRITE]
                  bit 7~0: Drawing plane selection
                            00h=plane 0
                            01h=plane 1
Description     o Select the drawing screen for CPU and GDC to access VRAM.
                o Valid only in standard graphics mode.
                o Plane 1 does not exist in the first generation PC-9801/U.
Related           I/O 00A4h


-------------------------------------------------------------------------------


■Text display line counter control circuit
Chip              CRTC(μPD52611)
Target            Normal, high resolution
Explanation     o CRTC controls the vertical synchronization of characters displayed on the text screen,
                  and outputs the CG line counter, address addition timing, and underline.
                o Smooth vertical scrolling of the text screen is possible by controlling CRTC.
                o See CRTC data sheet for details.
Related           I/O 0060h
                  I/O 0062h


I/O               0070h
Name              Character position line number (PL)
Target            Normal, high resolution
Function
                  [READ] None
                  [WRITE]
                  bit 7~0: Character position line number
Explanation     o Set the initial value of the line counter
                o Set as the two's complement of the line number on which the character is displayed.
Related           I/O 0072h
                  I/O 0074h
                  I/O 0076h
                  I/O 0078h
                  I/O 007Ah


I/O               0072h
Name              Body face line number specification (BL)
Function
                  [READ] None
                  [WRITE] Number of body face lines
Description     o Set the number of lines for the character's body face.
                o Set as number of body/face lines -1.
Related           I/O 0070h
                  I/O 0074h
                  I/O 0076h
                  I/O 0078h
                  I/O 007Ah


I/O               0074h
Name              Number of character lines (CL)
Function
                  [READ] None
                  [WRITE] Number of character lines
Description     o Set the number of lines for the character.
Related           I/O 0070h
                  I/O 0072h
                  I/O 0076h
                  I/O 0078h
                  I/O 007Ah


I/O               0076h
Name              Number of smooth scroll lines (SSL)
Function
                  [READ] None
                  [WRITE] Number of smooth scroll lines
Description     o Sets the number of lines that the characters in the scroll area are scrolling.
Related           I/O 0070h
                  I/O 0072h
                  I/O 0074h
                  I/O 0078h
                  I/O 007Ah


I/O               0078h
Name              Scroll area top position line number (SUR)
Function
                  [READ] None
                  [WRITE] Scroll area top position line number
Description     o Set the top line of the scroll area.
                o Set as the two's complement of the line number at the top of the scroll area.
Related           I/O 0070h
                  I/O 0072h
                  I/O 0074h
                  I/O 0076h
                  I/O 007Ah


I/O               007Ah
Name              Number of scroll area lines (SDR)
Function
                  [READ] None
                  [WRITE] Number of scroll area lines
Description     o Set the number of lines in the scroll area.
                o Set as the number of lines in the scroll area - 1.
Related           I/O 0070h
                  I/O 0072h
                  I/O 0074h
                  I/O 0076h
                  I/O 0078h


-------------------------------------------------------------------------------


■Character generator
Target            Normal, high resolution
Description     o The character generator generates font patterns for characters displayed on the text screen.
                  Use these ports when getting this font pattern from the CPU.
                o The first generation of PC-9801 does not support user-defined characters, PC-9801E, F, M, and U
                  can use 63 characters, PC-H98 can use 219 characters, and other characters can use 188 characters.
                o When the Kanji access mode is code access, you can read and write font patterns at high speed, but
                  the screen may become distorted unless VSYNC is in progress. On the other hand, although the dot
                  access mode is slow, it is possible to access the font pattern even during the display period.
                o Models equipped with a CG window can access font patterns at high speed not only through I/O ports
                  but also by projecting part of the character generator into memory space.
                o Characters whose JIS code first byte is 2C to 2Fh and 76h or higher (full-width ruled special characters,
                  user-defined characters, and extended kanji fonts can only be read from odd-numbered addresses in the CG window.
Related           A400:0000h~
                  I/O 0068h - 0Ah,0Bh
                  0000:0546h
                  0000:054Ch


I/O               00A1h
Name              Character code 2nd byte
                  CG window code specification ■ [Models equipped with CG window]
Target            Normal, high resolution
Function
                  [READ] None
                  [WRITE]
                  bit 7~0: Character code 2nd byte
                            00h=ANK font
                            01~DFh= Kanji font
Description     o Specify the code of the character pattern to be accessed.
                o For ANK fonts, set it to 00h, and for Kanji fonts, set it to the second byte of the JIS code minus 20h.
                o For models equipped with a CG window, it is also used to specify the code for the character pattern projected on the CG window.
Related           I/O 00A3h


I/O               00A3h
Name              Character code 1st byte
                  CG window code specification ■ [Models equipped with CG window]
Target            Normal, high resolution
Function
                  [READ] None
                  [WRITE]
                  bit 7~0: Character code 1st byte
                            00h=ANK font
                            01~08h=Kanji font
                            09~0Bh=2 bytes half-width
                            0C~DFh=Kanji font
Description     o Specify the code of the character pattern to be accessed.
                o For ANK fonts, set the value as is; for Kanji fonts, set the value by subtracting 20h from the first byte of the JIS code.
                o For models equipped with a CG window, it is also used to specify the code for the character pattern projected on the CG window.
Related           I/O 00A1h


I/O               00A5h
Name              Line counter
Target            Normal, high resolution
Function
                  [READ] None
                  [WRITE] Specify left and right, line number
                  bit 7,6: Unused (always set to 00b)
                  bit 5: L/R
                         1=Left
                         0=Right
                  * Specify which font pattern to read, the left or right side of full-width characters.
                  bit 4~0: RC4~RC0
                  * Specify which line of the font pattern to read/write. In normal mode, RC4 is always set to 0 because
                    only fonts with a maximum length of 16 dots are read.
Explanation     o Specify the raster position and left or right side of the character pattern to be referenced.
Related           I/O 00A1h
                  I/O 00A3h
                  I/O 00A9h


I/O               00A9h
Name              Character pattern data
Target            Normal, high resolution
Function
                  [READ] Read character pattern
                  [WRITE] Write character pattern
Description     o Read/write data of character pattern specified by I/O 00A1h, 00A3h, 00A5h. Writing is possible only in the user-defined character area.
                o ANK font size (6x7 dots, 7x13 dots) is 0068h port
                  Specify with (mode register 1).
Related           I/O 00A1h
                  I/O 00A3h
                  I/O 00A5h
                  I/O 0068h - 0Ah,0Bh


-------------------------------------------------------------------------------


■Graphic charger (GRCG)
Target            GRCG equipped models (normal, high resolution)
Explanation     o GRCG exists between the CPU and VRAM and is used to speed up graphics processing.
                  Since four planes can be accessed simultaneously, it is possible to speed up the drawing process.
                o GRCG has three modes: TDW, TCR, and RMW.
                  -----+-------------------------------------------------------
                  Mode | Function
                  -----+-------------------------------------------------------
                  TDW  | Writes the contents of the tile register to VRAM by a write operation from the CPU.
                       | Data from the CPU is ignored.
                  -----+-------------------------------------------------------
                  TCR  | When the CPU reads VRAM, only the bits that match the data in the tile registers of
                       | each plane and the four VRAMs return 1, and 0 is returned for the bits that do not match.
                  -----+-------------------------------------------------------
                  RMW  | In a write operation from the CPU, the contents of the tile register are written to the bit
                       | for which 1 is written, and the contents of the original VRAM are written to VRAM for the bit
                       | for which 0 is written.
                  -----+-------------------------------------------------------
                o The I/O address is different between normal mode and high resolution mode.
                o Since each register of GRCG cannot be read, it is necessary to save the current settings in a system-wide area.
                o For models equipped with EGC, EGC is usually upwardly compatible with GRCG, and VRAM access from GDC is GRCG can also be used for Seth.
Related           0000:0495h
                  0000:0496~0499h
                  0000:054Ch bit 1
                  I/O 006Ah - 04h,05h
                  I/O 04A0~04AFh


I/O               007Ch
Name              GRCG mode register
Target            Normal
Function
                  [READ] None
                  [WRITE] Write mode register
                  bit 7: CGmode
                         1=GRCG enabled
                         0=GRCG disabled
                         * GRCG mode selection
                  bit 6: RMWmode
                         1=RMW mode when writing
                         0=TCR mode when reading, TDW mode when writing
                         * CPU VRAM access selection
                  bit 5,4: 00b
                  bit 3~0: P3EN#~P0EN#
                            1=disabled
                            0=enabled
                            * Select the appropriate plane

Explanation     o Configure the graphics charger.
Related           0000:0495h
                  I/O 006Ah - 04h,05h
                  I/O 007Eh


I/O               007Eh
Name              GRCG Tile Register
Target            Normal
Function
                  [READ] None
                  [WRITE]
                  bit 7~0: Tile register (0~3)

Description     o Sets the graphics charger tile register.
                o Writing to I/O 007Ch resets the tile register counter, and subsequent four consecutive writes set tile registers 0 to 3.
Related           0000:0496~0499h
                  I/O 007Ch


I/O               00A4h
Name              GRCG mode register
Target            High resolution
Function
                  [READ] None
                  [WRITE] Write mode register
                  bit 7: CGmode
                         1=GRCG enabled
                         0=GRCG disabled
                         * GRCG mode selection
                  bit 6: RMWmode
                         1=RMW mode when writing
                         0=TCR mode when reading, TDW mode when writing
                         * CPU VRAM access selection
                  bit 5,4: RP1,RP2
                           11b=Plane #3 selection
                           10b=Plane #2 selection
                           01b=Plane #1 selection
                           00b=Plane #0 selection
                           * Select VRAM plane when reading CPU.
                             Valid only when CGmode=1
                  bit 3~0: P3EN#~P0EN#
                            1=disabled
                            0=enabled
                            * Select the appropriate plane
Explanation     o Set the mode register of GRCG in high resolution mode.
Related           0000:0495h
                  I/O 006Ah - 04h,05h
                  I/O 00A6h


I/O               00A6h
Name              GRCG Tile Register
Target            High resolution
Function
                  [READ] None
                  [WRITE]
                  bit 7~0: Tile register (0~3)
Description     o Sets the graphics charger tile register.
                o Writing to I/O 00A4h resets the tile register counter, and subsequent four consecutive writes set tile registers 0 to 3.
Related           0000:0496~0499h
                  I/O 00A4h


-------------------------------------------------------------------------------


■Palette register (8 color mode)
Target            Normal
Explanation     o The palette register in 8-color mode can be read and written at any time. Reading and writing can be done in any order.
Related           I/O 006Ah - 00h


I/O               00A8h
Name              Palette register #3,#7
Function
                  [READ/WRITE]
                  bitT 7〜4: 0,B,G,R
                  bitT 3〜0: 0,B,G,R
Description     o Set the palette in 8-color mode.
                o The upper 4 bits specify the color of palette #3, and the lower 4 bits specify the color of palette #7.


I/O               00AAh
Name              Palette register #2, #6
Function
                  [READ/WRITE]
                  bitT 7〜4: 0,B,G,R
                  bitT 3〜0: 0,B,G,R
Description     o Set the palette in 8-color mode.
                o The upper 4 bits specify the color of palette #2, and the lower 4 bits specify the color of palette #6.


I/O               00ACh
Name              Palette register #1,#5
Function
                  [READ/WRITE]
                  bitT 7〜4: 0,B,G,R
                  bitT 3〜0: 0,B,G,R
Description     o Set the palette in 8-color mode.
                o The upper 4 bits specify the color of palette #1, and the lower 4 bits specify the color of palette #5.


I/O               00AEh
Name              Palette register #0/#4
Function
                  [READ/WRITE]
                  bitT 7〜4: 0,B,G,R
                  bitT 3〜0: 0,B,G,R
Description     o Set the palette in 8-color mode.
                o The upper 4 bits specify the color of palette #0, and the lower 4 bits specify the color of palette #4.


-------------------------------------------------------------------------------


■Palette register (16 color mode)
Target            PC-9801U or later
                  However, PC-9801U/VF/VM is equipped with a 16-color board.
Explanation     o 16 color mode does not exist in the first generation PC-9801 E・F・M.
                o After specifying the pallet number with I/O 00A8h, specify the pallet with I/O 00AA~00AEh.
                o With PC-H98, pallet data can be read as shown below. 
                * After specifying the palette number, read in the order of R, G, B.
                * Read is performed during BLANK.
                * Shift the read value 4 bits to the right.
                u For PC-98GS, PC-9821, PC-9801BA2/BS2/BX2/NS/A, pallet data can be read as shown below.
                * After specifying the palette number, R, G, and B can be read in any order.
                * Readable at all times
Related           I/O 006Ah - 01h


I/O               00A8h
Name              Palette number specification register
Function
                  [READ]■[PC-H98,PC-98GS,PC-9821,PC-9801BA2・BS2・BX2・NS/A only]
                  [WRITE]
                  bit 7~4: Unused (always set to 0000b)
                  bit 3~0: Palette number
Explanation     o Specify the pallet number (00 to 0Fh).
Related           I/O 00AAh,00ACh,00AEh


I/O               00AAh
Name              Green level specification
Function
                  [READ]■[PC-H98]
                  bit 7~4: Green level (00~0Fh)
                  bit 3~0: unused
                  [READ]■[PC-98GS,PC-9821,PC-9801BA2・BS2・BX2・NS/A only]
                  bit 7~4: Unused (always set to 0000b)
                  bit 3~0: Green level (00~0Fh)
                  [WRITE]
                  bit 7~4: Unused (always set to 0000b)
                  bit 3~0: Green level (00~0Fh)
Description     o Specifies the green level of the palette specified by I/O 00A8h.
Related           I/O 00A8h,00ACh,00AEh


I/O               00ACh
Name              Red level designation
Function
                  [READ]■[PC-H98]
                  bit 7~4: Red level (00~0Fh)
                  bit 3~0: unused
                  [READ]■[PC-98GS,PC-9821,PC-9801BA2・BS2・BX2・NS/A only]
                  bit 7~4: Unused (always set to 0000b)
                  bit 3~0: Red level (00~0Fh)
                  [WRITE]
                  bit 7~4: Unused (always set to 0000b)
                  bit 3~0: Red level (00~0Fh)
Description     o Specifies the red level of the palette specified by I/O 00A8h.
Related           I/O 00A8h,00AAh,00AEh


I/O               00AEh
Name              Blue level designation
Function
                  [READ]■[PC-H98]
                  bit 7~4: Blue level (00~0Fh)
                  bit 3~0: unused
                  [READ]■[PC-98GS,PC-9821,PC-9801BA2・BS2・BX2・NS/A only]
                  bit 7~4: Unused (always set to 0000b)
                  bit 3~0: Blue level (00~0Fh)
                  [WRITE]
                  bit 7~4: Unused (always set to 0000b)
                  bit 3~0: Blue level (00~0Fh)
Description     o Specifies the blue level of the palette specified by I/O 00A8h.
Related           I/O 00A8h,00AAh,00ACh


-------------------------------------------------------------------------------


■Palette register (256 color mode)
Target            PC-H98, models equipped with extended graph architecture
Explanation     o After specifying the pallet number with I/O 00A8h, specify the pallet with I/O 00AA~00AEh.
                u The upper 4 bits of each brightness are supplied to the PC-9821Ne's liquid crystal display.
                o With PC-H98, writing is possible at all times in high-speed palette writing mode. However, the screen may be distorted. Writes during BLANK except in high-speed palette write mode.
                o On PC-H98, read pallet data as follows.
                * After specifying the palette number, read in the order of R, G, B.
                * Read is performed during BLANK.
                u For models equipped with extended graph architecture, read pallet data as follows.
                * After specifying the palette number, R, G, and B can be read in any order.
                * Readable at all times


PC-9821 256-color palette initial settings

  N = Palette number (パレット番号)
  R = Red (赤)
  G = Green (緑)
  B = Blue (青)

       [N][G][R][B]        [N][G][R][B]        [N][G][R][B]        [N][G][R][B]
       00 00 00 00         40 3F FF 5F         80 9F 3F 7F         C0 DF 5F 9F
       01 00 80 00         41 5F 3F 5F         81 9F 5F 7F         C1 DF 7F 9F
       02 80 00 00         42 5F 5F 5F         82 9F 7F 7F         C2 DF 9F 9F
       03 80 80 00         43 5F 7F 5F         83 9F 9F 7F         C3 DF BF 9F
       04 00 00 80         44 5F 9F 5F         84 9F BF 7F         C4 DF DF 9F
       05 00 80 80         45 5F BF 5F         85 9F DF 7F         C5 DF FF 9F
       06 80 00 80         46 5F DF 5F         86 9F FF 7F         C6 FF 3F 9F
       07 C0 C0 C0         47 5F FF 5F         87 BF 3F 7F         C7 FF 5F 9F
       08 DC C0 C0         48 7F 3F 5F         88 BF 5F 7F         C8 FF 7F 9F
       09 C8 A4 F0         49 7F 5F 5F         89 BF 7F 7F         C9 FF 9F 9F
       0A 3F 5F 3F         4A 7F 7F 5F         8A BF 9F 7F         CA FF BF 9F
       0B 3F 7F 3F         4B 7F 9F 5F         8B BF BF 7F         CB FF DF 9F
       0C 3F 9F 3F         4C 7F BF 5F         8C BF DF 7F         CC FF FF 9F
       0D 3F BF 3F         4D 7F DF 5F         8D BF FF 7F         CD 3F 3F BF
       0E 3F DF 3F         4E 7F FF 5F         8E DF 3F 7F         CE 3F 5F BF
       0F 3F FF 3F         4F 9F 3F 5F         8F DF 5F 7F         CF 3F 7F BF
       10 5F 3F 3F         50 9F 5F 5F         90 DF 7F 7F         D0 3F 9F BF
       11 5F 5F 3F         51 9F 7F 5F         91 DF 9F 7F         D1 3F BF BF
       12 5F 7F 3F         52 9F 9F 5F         92 DF BF 7F         D2 3F DF BF
       13 5F 9F 3F         53 9F BF 5F         93 DF DF 7F         D3 3F FF BF
       14 5F BF 3F         54 9F DF 5F         94 DF FF 7F         D4 5F 3F BF
       15 5F DF 3F         55 9F FF 5F         95 FF 3F 7F         D5 5F 5F BF
       16 5F FF 3F         56 BF 3F 5F         96 FF 5F 7F         D6 5F 7F BF
       17 7F 3F 3F         57 BF 5F 5F         97 FF 7F 7F         D7 5F 9F BF
       18 7F 5F 3F         58 BF 7F 5F         98 FF 9F 7F         D8 5F BF BF
       19 7F 7F 3F         59 BF 9F 5F         99 FF BF 7F         D9 5F DF BF
       1A 7F 9F 3F         5A BF BF 5F         9A FF DF 7F         DA 5F FF BF
       1B 7F BF 3F         5B BF DF 5F         9B FF FF 7F         DB 7F 3F BF
       1C 7F DF 3F         5C BF FF 5F         9C 3F 3F 9F         DC 7F 5F BF
       1D 7F FF 3F         5D DF 3F 5F         9D 3F 5F 9F         DD 7F 7F BF
       1E 9F 3F 3F         5E DF 5F 5F         9E 3F 7F 9F         DE 7F 9F BF
       1F 9F 5F 3F         5F DF 7F 5F         9F 3F 9F 9F         DF 7F BF BF
       20 9F 7F 3F         60 DF 9F 5F         A0 3F BF 9F         E0 7F DF BF
       21 9F 9F 3F         61 DF BF 5F         A1 3F DF 9F         E1 7F FF BF
       22 9F BF 3F         62 DF DF 5F         A2 3F FF 9F         E2 9F 3F BF
       23 9F DF 3F         63 DF FF 5F         A3 5F 3F 9F         E3 9F 5F BF
       24 9F FF 3F         64 FF 3F 5F         A4 5F 5F 9F         E4 9F 7F BF
       25 BF 3F 3F         65 FF 5F 5F         A5 5F 7F 9F         E5 9F 9F BF
       26 BF 5F 3F         66 FF 7F 5F         A6 5F 9F 9F         E6 9F BF BF
       27 BF 7F 3F         67 FF 9F 5F         A7 5F BF 9F         E7 9F DF BF
       28 BF 9F 3F         68 FF BF 5F         A8 5F DF 9F         E8 9F FF BF
       29 BF BF 3F         69 FF DF 5F         A9 5F FF 9F         E9 BF 3F BF
       2A BF DF 3F         6A FF FF 5F         AA 7F 3F 9F         EA BF 5F BF
       2B BF FF 3F         6B 3F 3F 7F         AB 7F 5F 9F         EB BF 7F BF
       2C DF 3F 3F         6C 3F 5F 7F         AC 7F 7F 9F         EC BF 9F BF
       2D DF 5F 3F         6D 3F 7F 7F         AD 7F 9F 9F         ED BF BF BF
       2E DF 7F 3F         6E 3F 9F 7F         AE 7F BF 9F         EE BF DF BF
       2F DF 9F 3F         6F 3F BF 7F         AF 7F DF 9F         EF BF FF BF
       30 DF BF 3F         70 3F DF 7F         B0 7F FF 9F         F0 DF 3F BF
       31 DF DF 3F         71 3F FF 7F         B1 9F 3F 9F         F1 DF 5F BF
       32 DF FF 3F         72 5F 3F 7F         B2 9F 5F 9F         F2 DF 7F BF
       33 FF 3F 3F         73 5F 5F 7F         B3 9F 7F 9F         F3 DF 9F BF
       34 FF 5F 3F         74 5F 7F 7F         B4 9F 9F 9F         F4 DF BF BF
       35 FF 7F 3F         75 5F 9F 7F         B5 9F BF 9F         F5 DF DF BF
       36 FF 9F 3F         76 5F BF 7F         B6 9F DF 9F         F6 FB FF F0
       37 FF BF 3F         77 5F DF 7F         B7 9F FF 9F         F7 A0 A0 A4
       38 FF DF 3F         78 5F FF 7F         B8 BF 3F 9F         F8 80 80 80
       39 FF FF 3F         79 7F 3F 7F         B9 BF 5F 9F         F9 00 FF 00
       3A 3F 3F 5F         7A 7F 5F 7F         BA BF 7F 9F         FA FF 00 00
       3B 3F 5F 5F         7B 7F 7F 7F         BB BF 9F 9F         FB FF FF 00
       3C 3F 7F 5F         7C 7F 9F 7F         BC BF BF 9F         FC 00 00 FF
       3D 3F 9F 5F         7D 7F BF 7F         BD BF DF 9F         FD 00 FF FF
       3E 3F BF 5F         7E 7F DF 7F         BE BF FF 9F         FE FF 00 FF
       3F 3F DF 5F         7F 7F FF 7F         BF DF 3F 9F         FF FF FF FF


/* PC-9821 Algorithm that determines the initial value of the unbranded 256-color palette */
/* Algorithm that determines the initial value of the 256-color palette without PC-9821 */
/* (However, this does not hold true for 00-09, F6-FFH. This range is shown in the table) */
/* It is easier to configure, so it is not shown as a program. */
#include <stdio.h>

void main()
{
    int n, r, g, b
    for (n = 0xa; n < 0xf6; n++) {
        g = (((n - 9) / 7) % 7 * 2 + 3) * 0x10 + 0xf
        r =  ((n - 9)      % 7 * 2 + 3) * 0x10 + 0xf
        b = (((n - 9) / 49)    * 2 + 3) * 0x10 + 0xf
        printf("%02x:G=%02x,R=%02x,B=%02x¥n", n, g, r, b)
    }
}


PC-9821Ap, As, Ae 256 color palette initial settings

  N = Palette number (パレット番号)
  R = Red (赤)
  G = Green (緑)
  B = Blue (青)

       [N][G][R][B]        [N][G][R][B]        [N][G][R][B]        [N][G][R][B]
       00 00 00 00         40 3C 3C 3C         80 7C 7C 7C         C0 BC BC BC
       01 00 00 07         41 00 00 47         81 00 00 87         C1 00 00 C7
       02 00 07 00         42 00 47 00         82 00 87 00         C2 00 C7 00
       03 00 07 07         43 00 47 47         83 00 87 87         C3 00 C7 C7
       04 07 00 00         44 47 00 00         84 87 00 00         C4 C7 00 00
       05 07 00 07         45 47 00 47         85 87 00 87         C5 C7 00 C7
       06 07 07 00         46 47 47 00         86 87 87 00         C6 C7 C7 00
       07 07 07 07         47 47 47 47         87 87 87 87         C7 C7 C7 C7
       08 04 04 04         48 44 44 44         88 84 84 84         C8 C4 C4 C4
       09 00 00 0F         49 00 00 4F         89 00 00 8F         C9 00 00 CF
       0A 00 0F 00         4A 00 4F 00         8A 00 8F 00         CA 00 CF 00
       0B 00 0F 0F         4B 00 4F 4F         8B 00 8F 8F         CB 00 CF CF
       0C 0F 00 00         4C 4F 00 00         8C 8F 00 00         CC CF 00 00
       0D 0F 00 0F         4D 4F 00 4F         8D 8F 00 8F         CD CF 00 CF
       0E 0F 0F 00         4E 4F 4F 00         8E 8F 8F 00         CE CF CF 00
       0F 0F 0F 0F         4F 4F 4F 4F         8F 8F 8F 8F         CF CF CF CF
       10 0C 0C 0C         50 4C 4C 4C         90 8C 8C 8C         D0 CC CC CC
       11 00 00 17         51 00 00 57         91 00 00 97         D1 00 00 D7
       12 00 17 00         52 00 57 00         92 00 97 00         D2 00 D7 00
       13 00 17 17         53 00 57 57         93 00 97 97         D3 00 D7 D7
       14 17 00 00         54 57 00 00         94 97 00 00         D4 D7 00 00
       15 17 00 17         55 57 00 57         95 97 00 97         D5 D7 00 D7
       16 17 17 00         56 57 57 00         96 97 97 00         D6 D7 D7 00
       17 17 17 17         57 57 57 57         97 97 97 97         D7 D7 D7 D7
       18 14 14 14         58 54 54 54         98 94 94 94         D8 D4 D4 D4
       19 00 00 1F         59 00 00 5F         99 00 00 9F         D9 00 00 DF
       1A 00 1F 00         5A 00 5F 00         9A 00 9F 00         DA 00 DF 00
       1B 00 1F 1F         5B 00 5F 5F         9B 00 9F 9F         DB 00 DF DF
       1C 1F 00 00         5C 5F 00 00         9C 9F 00 00         DC DF 00 00
       1D 1F 00 1F         5D 5F 00 5F         9D 9F 00 9F         DD DF 00 DF
       1E 1F 1F 00         5E 5F 5F 00         9E 9F 9F 00         DE DF DF 00
       1F 1F 1F 1F         5F 5F 5F 5F         9F 9F 9F 9F         DF DF DF DF
       20 1C 1C 1C         60 5C 5C 5C         A0 9C 9C 9C         E0 DC DC DC
       21 00 00 27         61 00 00 67         A1 00 00 A7         E1 00 00 E7
       22 00 27 00         62 00 67 00         A2 00 A7 00         E2 00 E7 00
       23 00 27 27         63 00 67 67         A3 00 A7 A7         E3 00 E7 E7
       24 27 00 00         64 67 00 00         A4 A7 00 00         E4 E7 00 00
       25 27 00 27         65 67 00 67         A5 A7 00 A7         E5 E7 00 E7
       26 27 27 00         66 67 67 00         A6 A7 A7 00         E6 E7 E7 00
       27 27 27 27         67 67 67 67         A7 A7 A7 A7         E7 E7 E7 E7
       28 24 24 24         68 64 64 64         A8 A4 A4 A4         E8 E4 E4 E4
       29 00 00 2F         69 00 00 6F         A9 00 00 AF         E9 00 00 EF
       2A 00 2F 00         6A 00 6F 00         AA 00 AF 00         EA 00 EF 00
       2B 00 2F 2F         6B 00 6F 6F         AB 00 AF AF         EB 00 EF EF
       2C 2F 00 00         6C 6F 00 00         AC AF 00 00         EC EF 00 00
       2D 2F 00 2F         6D 6F 00 6F         AD AF 00 AF         ED EF 00 EF
       2E 2F 2F 00         6E 6F 6F 00         AE AF AF 00         EE EF EF 00
       2F 2F 2F 2F         6F 6F 6F 6F         AF AF AF AF         EF EF EF EF
       30 2C 2C 2C         70 6C 6C 6C         B0 AC AC AC         F0 EC EC EC
       31 00 00 37         71 00 00 77         B1 00 00 B7         F1 00 00 F7
       32 00 37 00         72 00 77 00         B2 00 B7 00         F2 00 F7 00
       33 00 37 37         73 00 77 77         B3 00 B7 B7         F3 00 F7 F7
       34 37 00 00         74 77 00 00         B4 B7 00 00         F4 F7 00 00
       35 37 00 37         75 77 00 77         B5 B7 00 B7         F5 F7 00 F7
       36 37 37 00         76 77 77 00         B6 B7 B7 00         F6 F7 F7 00
       37 37 37 37         77 77 77 77         B7 B7 B7 B7         F7 F7 F7 F7
       38 34 34 34         78 74 74 74         B8 B4 B4 B4         F8 F4 F4 F4
       39 00 00 3F         79 00 00 7F         B9 00 00 BF         F9 00 00 FF
       3A 00 3F 00         7A 00 7F 00         BA 00 BF 00         FA 00 FF 00
       3B 00 3F 3F         7B 00 7F 7F         BB 00 BF BF         FB 00 FF FF
       3C 3F 00 00         7C 7F 00 00         BC BF 00 00         FC FF 00 00
       3D 3F 00 3F         7D 7F 00 7F         BD BF 00 BF         FD FF 00 FF
       3E 3F 3F 00         7E 7F 7F 00         BE BF BF 00         FE FF FF 00
       3F 3F 3F 3F         7F 7F 7F 7F         BF BF BF BF         FF FF FF FF


/* Algorithm that determines the initial value of the 256-color palette of PC-9821Ap, As, Ae */
#include <stdio.h>

void main()
{
    int n, r, g, b
    for (n = 0; n < 256; n++) {
        if (n & 7) {
            g = (n & 4) / 4 * (n | 7)
            r = (n & 2) / 2 * (n | 7)
            b = (n & 1)     * (n | 7)
        } else if (n)
            r = g = b = n - 4
        else /* if (n == 0) */
            r = g = b = 0
        printf("%02x:G=%02x,R=%02x,B=%02x¥n", n, g, r, b)
    }
}
Related           I/O 006Ah - 21h
                  I/O 006Ah - 2Ah,2Bh■[PC-H98]


I/O               00A8h
Name              Palette number specification register
Function
                  [READ/WRITE]
                  bit 7~0: Palette number
Explanation     o Specify the pallet number (00 to FFh).
Related           I/O 00AAh,00ACh,00AEh


I/O               00AAh
Name              Green level specification
Function
                  [READ/WRITE]
                  bit 7~0: Green level (00~FFh)
Description     o Read/write the green level of the palette specified by I/O 00A8h.
Related           I/O 00A8h,00ACh,00AEh


I/O               00ACh
Name              Red level designation
Function
                  [READ/WRITE]
                  bit 7~0: Red level (00~FFh)
Description     o Read and write the red level of the palette specified by I/O 00A8h.
Related           I/O 00A8h,00AAh,00AEh


I/O               00AEh
Name              Blue level designation
Function
                  [READ/WRITE]
                  bit 7~0: Blue level (00~FFh)
Description     o Read and write the blue level of the palette specified by I/O 00A8h.
Related           I/O 00A8h,00AAh,00ACh


I/O               09A2h
Name              256 color palette light status flag
Target            PC-H98
Function
                  [READ]
                  bit 7~1: unused
                  bit 0: ST
                  [WRITE] None
Explanation     o When 256-color palette high-speed writing is OFF, you must confirm that this ST (bit 0) is 0 before setting the value. By setting the value, ST becomes 1 and lasts up to 41μs.
Related           I/O 006Ah - 2Ah,2Bh
                  I/O 00A8h,00AAh,00ACh,00AEh


-------------------------------------------------------------------------------


■Other graphics related
Explanation     o In PC-H98, PC-98GS, PC-9821, etc., some of the various graphic-related functions have been expanded.
                o Most of these functions usually do not need to be operated, and careless operation may cause instability. It should not be operated unless absolutely necessary.


I/O               09A0h
Name              Various graphic related status readout
Undocumented
Target            PC-98GS, PC-H98, PC-9821■[Excluding PC-9821Ts], PC-9801BA2・BS2・BX2・BX3・BA3・BX4・NS/A
Function
                  [WRITE]
                  bit 7~0: Read status selection
                  * Select information to input from I/O 09A0h bit 0
                  [READ]
                  bit 7~2: unused
                  bit 1: Graphic GDC clock frequency readout
                         0=2.5MHz
                         1=5.0MHz
                         Related I/O 006Ah - 84h,85h
                  bit 0: Reading various graphics related status.

                         The data to be read is selected according to the value written to I/O 09A0h last.
                         --------+-------------------------------------------------------
                                 | Contents
                         --------+-------------------------------------------------------
                         00h     | I/O 09A0h Not used
                                 | * Set so that FFh is always read from I/O 09A0h■[As2]
                         --------+-------------------------------------------------------
                         01h     | Color/monochrome setting for 200 lines
                                 | Return 0 to bit 0 when in OUT 0068h,02h status (color mode)
                                 | Return 1 to bit 0 when in OUT 0068h,03h status (monochrome mode)
                                 | Related I/O 0068h - 02h,03h
                         --------+-------------------------------------------------------
                         02h     | Odd raster mask
                                 | OUT 0068h,08h status returns 0 to bit 0 (mask)
                                 | Return 1 to bit 0 when in OUT 0068h,09h status (mask)
                                 | Related I/O 0068h - 08h,09h
                         --------+-------------------------------------------------------
                         03h     | Screen display ON/OFF
                                 | OUT 0068h,0Eh status returns 0 to bit 0 (screen display ON)
                                 | OUT 0068h, Returns 1 to bit 0 when in 0Fh state (screen display OFF)
                                 | Related I/O 0068h - 0Eh,0Fh
                         --------+-------------------------------------------------------
                         04h     | Palette mode
                                 | OUT 006Ah,00h status returns 0 to bit 0
                                 | (Digital palette mode)
                                 | Return 1 to bit 0 when in OUT 006Ah,01h state
                                 |  (analog palette mode)
                                 | Related I/O 006Ah - 00h,01h
                         --------+-------------------------------------------------------
                         05h     | GDC synchronous mode
                                 | OUT 006Ah,Return 0 to bit 0 when in 40h state
                                 | (CRT display mode)
                                 | OUT 006Ah, Returns 1 to bit 0 when in 41h state
                                 | (Plasma display mode)
                                 | Related I/O 006Ah - 40h,41h
                         --------+-------------------------------------------------------
                         06h     | Unknown
                                 | OUT 006Ah,44h status returns 0 to bit 0
                                 | OUT 006Ah, returns 1 to bit 0 when in 45h state
                                 | Related I/O 006Ah - 44h,45h
                         --------+-------------------------------------------------------
                         07h     | EGC mode
                                 | Return 0 to bit 0 when in OUT 006Ah,04h state (GRCG compatible mode)
                                 | Return 1 to bit 0 when in OUT 006Ah,05h state (EGC extended mode)
                                 | Related I/O 006Ah - 04h,05h
                         --------+-------------------------------------------------------
                         08h     | Mode F/F protection
                                 | Return 0 to bit 0 when in OUT 006Ah,06h state
                                 | (Mode F/F protection setting)
                                 | Return 1 to bit 0 when in OUT 006Ah,07h state
                                 | (Mode F/F protection cancelled)
                                 | Related I/O 006Ah - 06h,07h
                         --------+-------------------------------------------------------
                         09h     | GDC clock #0
                                 | OUT 006Ah, Return 0 to bit 0 when in 82h state
                                 | (GDC 2.5MHz mode)
                                 | OUT 006Ah, Return 1 to bit 0 when in 83h state
                                 | (GDC 5.0MHz mode)
                                 | Related I/O 006Ah - 82h,83h
                                 | I/O 09A0h bit 1
                         --------+-------------------------------------------------------
                         0Ah     | Graphics mode ■[PC-H98 series + 256 color board,
                                 | PC-9821 first generation・Ap・As・Ae・Ce・Ne・Af・Ap2・As2・Cs2・Ce2・
                                 | An・Np・Ns・Es・Xt・Xa・Xn・Xp・Xs・Xe・Xf・Ap3・As3・Cf・Cx・Cb・Ld]
                                 | OUT 006Ah, Returns 0 to bit 0 when in 20h state (16 color mode)
                                 | OUT 006Ah, Returns 1 to bit 0 when in 21h state (256 color mode)
                                 | Related I/O 006Ah - 20h,21h
                         --------+-------------------------------------------------------
                         0Bh     | VRAM access mode ■ [PC-H98 series + 256 color board]
                                 | Return 0 to bit 0 when in OUT 006Ah,62h state
                                 | (plain access mode)
                                 | OUT 006Ah, Returns 1 to bit 0 when in 63h state
                                 | (packed pixel mode)
                                 | Related I/O 006Ah - 62h,63h
                         --------+-------------------------------------------------------
                         0Ch     | Unknown
                         --------+-------------------------------------------------------
                         0Dh     | VRAM boundary mode
                                 | Return 0 to bit 0 when in OUT 006Ah,68h state (2 screen mode)
                                 | Return 1 to bit 0 when in OUT 006Ah,69h state (1 screen mode)
                                 | Related I/O 006Ah - 68h,69h
                         --------+-------------------------------------------------------
                         0Eh     | Graphics mode ■ [PC-H98 series + 256 color board]
                                 | OUT 006Ah, 22h status returns 0 to bit 0 (16/256 color mode?)
                                 | OUT 006Ah, Returns 1 to bit 0 when in 23h state (65536 color mode)
                                 | Related I/O 006Ah - 62h,63h
                         --------+-------------------------------------------------------
                         0Fh     | 65536 color palette mode ■[PC-H98 series + 256 color board]
                                 | OUT 006Ah, Return 0 to bit 0 when in 24h state
                                 | (does not use palette)
                                 | OUT 006Ah, Return 1 to bit 0 when in 25h state
                                 | (Some palettes are used)
                                 | Related I/O 006Ah - 24h,25h
                         --------+-------------------------------------------------------
                         10h     | Unknown■[H98]
                                 | OUT Returns 0 to bit 0 when in 006Ah,6Ah state
                                 | Return 1 to bit 0 when in OUT 006Ah,6Bh state
                                 | Related I/O 006Ah - 6Ah,6Bh
                         --------+-------------------------------------------------------
                         11h     | Full screen reverse mode■[PC-H98]
                                 | OUT 006Ah, Return 0 to bit 0 when in 26h state
                                 | (normal display)
                                 | Return 1 to bit 0 when in OUT 006Ah,27h state
                                 | (reverse display)
                                 | Related I/O 006Ah - 26h,27h
                         --------+-------------------------------------------------------
                         12h     | 256 colors overscan color■[PC-H98]
                                 | OUT 006Ah,Return 0 to bit 0 when in 2Ch state
                                 | (normal display)
                                 | Return 1 to bit 0 when in OUT 006Ah,2Dh state
                                 | (with overscan)
                                 | Related I/O 006Ah - 2Ch,2Dh
                         --------+-------------------------------------------------------
                         13h     | Full screen reverse mode■[PC-H98]
                                 | OUT 006Ah, Return 0 to bit 0 when in 28h state
                                 | (normal display)
                                 | Return 1 to bit 0 when in OUT 006Ah,29h state
                                 | (reverse display)
                                 | Related I/O 006Ah - 28h,29h
                         --------+-------------------------------------------------------
                         14h     | Drawing processor selection■[H98]
                                 | Return 0 to bit 0 when in OUT 006Ah,66h state
                                 | (GDC drawing)
                                 | Return 1 to bit 0 when in OUT 006Ah,67h state
                                 | (AGDC drawing)
                                 | Related I/O 006Ah - 66h,67h
                         --------+-------------------------------------------------------
                         15h     | Unknown■[H98]
                                 | OUT 006Ah, Return 0 to bit 0 when in 60h state
                                 | EGC
                                 | Return 1 to bit 0 when in OUT 006Ah,61h state
                                 | EEGC
                                 | Related I/O 006Ah - 60h,61h
                         --------+-------------------------------------------------------
                         16h     | Unknown■[H98]
                                 | Return 0 to bit 0 when in OUT 006Ah,C2h state
                                 | Return 1 to bit 0 when in OUT 006Ah,C3h state
                                 | Related I/O 006Ah - C2h,C3h
                         --------+-------------------------------------------------------
                         17h     | Bitmap composition direction■[PC-H98]
                                 | OUT 006Ah, Returns 0 to bit 0 when in 6Ch state (forward direction)
                                 | OUT Returns 1 to bit 0 when in 006Ah,6Dh state (reverse direction)
                                 | Related I/O 006Ah - 6Ch,6Dh
                         --------+-------------------------------------------------------
                         18h     | High-speed pallet writing ■ [PC-H98]
                                 | Return 0 to bit 0 when in OUT 006Ah,2Ah state
                                 | (palette writing normal)
                                 | Return 1 to bit 0 when in OUT 006Ah,2Bh state
                                 | (Palette writing fast)
                                 | Related I/O 006Ah - 2Ah,2Bh
                         --------+-------------------------------------------------------
                         19h     | Unknown■[H98]
                                 | OUT 006Ah,48h When in state, return 0 to bit 0
                                 | Return 1 to bit 0 when in OUT 006Ah,49h state
                                 | Related I/O 006Ah - 48h,49h
                         --------+-------------------------------------------------------
                         1Ah     | Unknown■[H98]
                                 | Return 0 to bit 0 when in OUT 006Ah,C8h state
                                 | Return 1 to bit 0 when in OUT 006Ah,C9h state
                                 | Related I/O 006Ah - C8h,C9h
                         --------+-------------------------------------------------------
                         1Bh     | Unknown■[H98]
                                 | Return 0 to bit 0 when in OUT 006Ah,2Eh state
                                 | Return 1 to bit 0 when in OUT 006Ah,2Fh state
                                 | Related I/O 006Ah - 2Eh,2Fh
                         --------+-------------------------------------------------------
                         1Ch     | Unknown■[H98]
                                 | Return 0 to bit 0 when in OUT 006Ah,6Eh state
                                 | Return 1 to bit 0 when in OUT 006Ah,6Fh state
                                 | Related I/O 006Ah - 6Eh,6Fh
                         --------+-------------------------------------------------------
                         1Dh     | Unknown■[H98]
                                 | OUT 006Ah, Return 0 to bit 0 when in C0h state
                                 | OUT 006Ah, Return 1 to bit 0 when in C1h state
                                 | Related I/O 006Ah - C0h,C1h
                         --------+-------------------------------------------------------
                         1Eh     | Unknown
                                 | out6ah,46h/out6ah,47h■[After Ne]
                                 | out6ah,80h/out6ah,81h
                                 | Related I/O 006Ah - 80h,81h■[PC-9821Ap・As・Ae]
                                 | I/O 006Ah - 46h,47h
                                 | ■[PC-9821Ce・Ne・Af・Ap2・As2
                                 | ・Cs2・Ce・An]
                         --------+-------------------------------------------------------
                         1Fh     | Unknown■[PC-9821Ap・As・Ae]
                                 | Related I/O 006Ah - 08h,09h
                         --------+-------------------------------------------------------
                         20h~FFh | Unused
                         --------+-------------------------------------------------------
Explanation     o It is possible to read various registers that cannot be read from the port.
Related           F8E8:0002h bit 7
                  I/O 0068h
                  I/O 006Ah


I/O               09A2h
Name              DPMS Control
Undocumented
Target            PC-9821Ap2・As2・Bp・Bs・Be・Bf・Cs2・Ce2・Ts・An・Xt・Xa・Xn・Xp・Xs・Xe・Xf・Cf・Cx・Cb
                  PC-9801BA2・BX2・BA2・BA3・BX3・BX4
Function
                  [READ/WRITE]
                  bit 7: VSYNC mask
                         0=do not mask
                         1=mask
                  bit 6: HSYNC mask
                         0=do not mask
                         1=mask
                  bit 6~0: Unused (set to 0)
Description     o Used to set display suspend mode
                o It is not desirable to directly manipulate this I/O to control the DPMS. If this I/O is directly manipulated,
                  the LCD display may become distorted on some models, such as 98NOTE series models that do not support DPMS.
                  By using INT 1Fh - Function 93h, it is possible to perform DPMS control without causing malfunctions on models
                  that do not support DPMS, so you should use it.
Related           INT 1Fh - Function 93h


I/O               09A4h
name              Unknown
Undocumented
Target            PC-H98

Explanation     o Details unknown


I/O               09A6h
Name              256 colors overscan color
Undocumented
Target            PC-H98
Function
                  [READ/WRITE]
                  bit 7~0: Overscan color
Description     o Specify the pallet number to be output in the overscan area.
Related           I/O 006Ah - 2Ch,2Dh
                  I/O 006Ch
                  I/O 00A8h
                  I/O 00AAh
                  I/P 00ACh
                  I/O 00AEh


I/O               09A8h
Name              Normal mode horizontal scanning frequency setting
Undocumented
Target            PC-98GS, PC-H98, PC-9821 [Excluding Ts], PC-9801BA2・BS2・BX2, PC-9801NS/A
Function
                  [READ/WRITE]■[Other than PC-9801NS/A]
                  bit 7~2: Unused (always set to 0)
                  bit 1,0: Frequency switching
                           11b=Setting prohibited
                           10b=Setting prohibited
                           01b=31.47kHz
                           00b=24.83kHz
                  [READ/WRITE]■[PC-9801NS/A]
                  bit 7: unknown
                  bit 6~0: Unused (always set to 0)

Description     o Switch the display frequency. After switching the display frequency, the display will not
                  display properly unless you reset the synchronization signal using GDC's SYNC command, etc.
                o Normally only the lower 1 bit is used and switches between 24kHz/31kHz.
                o If you operate this port in high resolution mode, the screen will be distorted.
                o It is now recommended to use 31kHz mode.
                u PC-9821Bp, Bs, Be, Bf, Xt, Xa, Xn, Xp, Xs, Can be set. Access to the programmable PLL synthesizer
                  also uses this I/O 09A8h, but it is normally masked and cannot be configured.
Related           INT 18h - Function 30h
                  INT 18h - Function 31h
                  0000:0459h bit 3
                  I/O 08F0h,08F2h - 0016h


I/O               09ACh
Name              High resolution mode horizontal scanning frequency setting
Undocumented
Target            PC-H98
                  PC-9821Ap・As・Ae・Af・Ap2・As2・An・Ap3・As3 + PC-9821A-E02 (98 high resolution board)
                  High resolution mode
Function
                  [READ/WRITE]
                  bit 7~2: Unused (always set to 0)
                  bit 1,0: Frequency switching
                           11b=Setting prohibited
                           10b=50kHz
                           01b=31.47kHz
                           00b=Setting prohibited
Description     o Switch the display frequency. After switching the display frequency, the display will not display
                  properly unless you reset the synchronization signal using GDC's SYNC command, etc.
                o If you operate this port in normal mode, the screen will be distorted.
Related           0000:0459h bit 3


I/O               09AEh
Name              Pixel mask
Target            PC-H98
Function
                  [READ/WRITE]
                  bit 7~0: PM7~0 Light pixel mask
Explanation     o By setting the corresponding bit of pixel data to 0, mask the writing of the corresponding bit of the pixel.
                o Normally, set FFh for 256 colors/16M colors, and 0Fh for 16 colors/16M colors.


I/O               0EA0h
Name              Unknown
Undocumented
Target            PC-H98
Function
                  [READ]
                  bit 7~0: Details unknown
                            00h=Normal mode
                            03h=25 line spacing in normal mode
                            06h=Interlaced in high resolution mode
                
                  [WRITE]
                  bit 7~0: Details unknown
                            00h=Normal mode
                            01h=Shrink vertically
                            02h=Shrink vertically
                            03h=25 line spacing in normal mode
                            04h=Screen shifts to the right
                            06h=Interlaced in high resolution mode

Explanation     o Details unknown
Related           0000:053Bh,0000:0452~0454h
                  0000:054Ch bit 4


I/O               0EA2h
Name              Memory wait setting?
Undocumented
Target            PC-H98
Function
                  [READ/WRITE]
                  bir 7~5: unused (always 000b)
                  bit 4: unknown (always 1)
                  bit 3: Memory wait
                         1=lots of weight
                         0=less weight
                         * Writing 1 to this bit increases the wait amount. Readable.
                  bit 2: Memory wait cancellation
                         1=wait cancel
                         0=wait cancel
                         * Writing 1 to this bit reduces the wait amount. Unable to read.
                  bit 1: Unused (always 0)
                  bit 0: unknown (always 1)
Description     o Increase or decrease the number of memory waits.


I/O               0EA4h
Name              Unknown
Undocumented
Target            PC-H98
Function
                  [WRITE]
                  bit 7~6: unused
                  bit 0: unknown
                         1=Screen is distorted
                         0=normal display
Explanation     o Details unknown
                o Graphic display related
Related           I/O 00A4h


I/O               0EA6h
Name              Unknown
Undocumented
Target            PC-H98
Function
                  [WRITE]
                  bit 7~6: unused
                  bit 0: unknown
                         1=Cannot draw correctly
                         0=normal drawing
Explanation     o Details unknown
                o Graphic drawing related
Related           I/O 00A6h


I/O               0EA8h
Name              Extended VRAM bank switching
Undocumented
Target            PC-H98 256 color mode
Function
                  [READ/WRITE]
                  00h= Bank #0
                  01h= Bank #1
Explanation     o Select the VRAM to access. Bank #0 is the first half of VRAM, bank #1 is the second half of VRAM, and one bank is a unit of 128KB.
Related           I/O 006Ah - 62h,63h
                  I/O 00A6h


I/O               0EAAh
Name              VRAM detachment
Undocumented
Target            PC-9821, PC-9801BA2・BS2・BX2・BA3・BX3・BX4・NS/A・NL/A
Function
                  [READ/WRITE]
                  bit 7~1: unused
                  bit 0: VRAM disconnection
                         1=do
                         0=no
Description     o Controls whether VRAM is separated from the CPU's memory space. Display will continue even if VRAM is disconnected.
                o Valid only on models where VRAM is connected to the local bus.
Related           A000:0000~7FFFh
                  A800:0000〜7FFFh
                  B000:0000~7FFFh
                  B800:0000〜7FFFh
                  E000:0000~7FFFh


I/O               0EACh
Name              Unknown
Undocumented
Target            PC-H98
Function
                  [WRITE/READ]
                  bit 7~0: unknown
Explanation     o Details unknown


I/O               0EAEh
Name              Unknown
Undocumented
Target            PC-H98
Function
                  [WRITE/READ]
                  bit 7~0: unknown
Explanation     o Details unknown


-------------------------------------------------------------------------------


■EEGC
Target            PC-H98
Explanation     o EEGC is an AGDC-compatible graphic charger installed in the PC-H98 series.
                o Details unknown.


I/O               08A0h
I/O               08A2h
I/O               08A4h
Explanation     o Details unknown
Related           I/O 006Ah - 60h,61h